<?php
#
# author: Cody Sorgenfrey with Jason Sanchez
# (c) 2012 Casa De Bendicion
#

include_once("common.php");

$title= "Media";
$metaKey=null;
$metaDesc="Pictures and Videos of the Orphanage.";
$moreHtml=null;
$moreJava=null;

startPage($title, $metaKey, $metaDesc, $moreHtml, $moreJava, $title);

printFacebookBanner();

printf("<br><br>");

//to get videos from mysql server
connectSelectTest("videos");

$result = mysql_query("SELECT * FROM `videos` ORDER BY `id` DESC LIMIT 0,4");

while ($videoRow = mysql_fetch_array($result)){
	
	$videos .= "<div class='indiVideo' style='width:50%; display:inline-block;'>".$videoRow['file']."</div>";
} 

if (userIsIE()){
	
	$first = "<div class='videos'><div id='mediaTitles' style='font-size:250%;'>videos</div><a id='onBlue' href='https://vimeo.com/46120827'><p>We're sorry, your browser doesn't support this video, click here to view.</p></a></div>";
}
else {
	
	$first = "<div class='videos'><div id='mediaTitles' style='font-size:250%;'>videos</div><div style='margin-top:25px;' id='videoHolder'>".$videos."</div></div>";
}

$result = mysql_query("SELECT * FROM `photoAlbums` ORDER BY `id` DESC");

while ($photoRow = mysql_fetch_array($result)){
	
	$photos .= "<div class='indiPhoto' style='width:50%; display:inline-block;'><a target='_blank' href='".$photoRow['link']."'><img id='coverPhoto' src='".$photoRow['image']."'></img><p>".$photoRow['name']."</p></a></div>";
} 

$second = "<div class='photos'><div id='mediaTitles' style='font-size:250%;'>photo albums <font size='2%'>(click to view)</font></div>".$photos."</div></br>";
$third = "<div style='height:5px; width:512px;'></div>";
$fourth = "<div style='height:5px; width:514px;'></div>";

printPageTable($first, $second, $third, $fourth);
endPage();
?>